﻿namespace ProjectIndieFarm
{
    public class ChallengeGroupBeans
    {
        public static void Setup(IChallengeSystem system)
        {
            var carrot1 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第 1个豆角")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountBeans > 0)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 200;
                    self.SendMessageWithReward(200);
                }));
            var carrot10 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第10个豆角")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountBeans >= 10)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 200;
                    self.SendMessageWithReward(200);
                }));
            var carrot20 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第20个豆角")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountBeans >= 20)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 200;
                    self.SendMessageWithReward(200);
                }));
            var carrot40 = system.Add(new GenericChallenge()
                .SetChallengeName("收获第40个豆角")
                .OnCheckFinish(self => ChallengeSystem.HarvestedCountBeans >= 40)
                .OnFinish(self =>
                {
                    Global.Coins.Value += 200;
                    Global.ShowPumpkinSeedInShop.Value = true;
                    self.SendMessageWithRewardAndOther(200, "商店新增<color=orange>南瓜种子</color>");
                }));
        }
    }
}
